Apparatus and method for coding/decoding image selectively using discrete cosine/sine transform

ABSTRACT

Disclosed is a data transmission system that transmits data by using a relay. The relay selects a transmission terminal from among a plurality of terminals accessing a base station. A base station transmits base station data to the relay during a first time slot, and the transmission terminal transmits terminal data to the relay. The relay transmits terminal data to the base station during a second time slot, and transmits base station data to the transmission terminal.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/045,511 filed on Oct. 3, 2013, which is a continuation of U.S. patentapplication Ser. No. 13/128,995 filed on May 12, 2011, which is aNational Stage application of International Application No.PCT/KR2009/005675 filed Oct. 5, 2009, which claims benefit under 35U.S.C. § 119(a) of Korean Patent Applications Nos. 10-2008-0097144 filedon Oct. 2, 2008, and 10-2009-0093127 filed on Sep. 30, 2009 in theKorean Intellectual Property Office, the contents of all of which areincorporated herein by reference in their entireties. The applicant(s)hereby rescind any disclaimer of claim scope in the parentapplication(s) or the prosecution history thereof and advise the USPTOthat the claims in this application may be broader than any claim in theparent application(s).

TECHNICAL FIELD

The present invention relates to a technology for coding/decoding animage.

BACKGROUND

Generally, a motion image coding method is classified into anintra-coding that performs coding of intra-image, such as an intra (I)frame, and an inter-coding that performs coding between images, such asa predictive (P) frame or a bidirectional (B) frame.

According to an image compression standard, such as H.263, MPEG-4 Part2, H.264/MPEG-4 AVC, and the like, a motion estimation is performedbased on a block unit. That is, the motion estimation may be performedbased on a macroblock unit or based on a sub-block unit that is obtainedby dividing the macroblock unit into two or four. The motion estimationmay be performed to reduce a bit rate by eliminating a temporalredundancy occurring when a motion image is coded. Particularly,H.264/MPEG-4 AVC uses various size of variable block-based motionestimation, thereby having a high coding efficiency.

A prediction of a motion vector may be performed with reference toeither a past image based on a time axis or both the past image and afuture image. An image used as a reference when performing coding ordecoding of a current frame may be referred to as a reference image. TheH.264/MPEG-4 AVC supports a multiple reference frames, and thus,H.264/MPEG-4 AVC selects a block of a frame having a highest redundancywith the current block as the reference image, thereby having a greatercoding efficiency than when a previous frame is only used as thereference image. Also, the H.264/MPEG-4 AVC uses a rate-distortionoptimization technology to select an optimum mode from among everypossible coding mode used for the motion estimation, such as thevariable block mode, a space prediction mode (Intra 16×16, Intra 8×8,Intra 4×4), a SKIP mode (P SKIP mode and B SKIP mode), a DIRECT mode,and the like, thereby further improving the coding efficiency of theH.264/MPEG-4 AVC.

According to the H.264/MPEG-4 AVC used for encoding and decoding motionimage data, a transform is used as a method of increasing a compressionrate of energy and decreasing a spatial correlation of a residual signalin a block after inter/intra image prediction is performed, andquantization is used for decreasing an energy of a transformedcoefficient after the transform is performed and for increasing thecompression rate.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an exemplary embodiment of animage coding apparatus where the present invention is applied;

FIG. 2 is a block diagram illustrating a configuration of an imagecoding apparatus according to an exemplary embodiment of the presentinvention;

FIG. 3 is a diagram illustrating a concept of an integer sine transformaccording to an exemplary embodiment of the present invention;

FIG. 4 is a diagram illustrating a value of a multiplication factor in aquantizing process with respect to a 4×4 blocksized image;

FIG. 5 is a diagram illustrating a value of a multiplication factor in aquantizing process with respect to an 8×8 blocksized image;

FIG. 6 is a diagram illustrating a value of a scaling factor in aninverse-quantizing process with respect to a 4×4 sized image;

FIG. 7 is a diagram illustrating a value of a scaling factor in aninverse-quantizing process with respect to an 8×8 sized image;

FIG. 8 is a diagram illustrating a concept of integer sine inversetransform according to an exemplary embodiment of the present invention;

FIG. 9 is a diagram illustrating a concept of a coefficient thresholdoperation according to an exemplary embodiment of the present invention;

FIG. 10 is a diagram illustrating an exemplary embodiment of storingtransform scheme information based on coded block pattern (CBP)according to an exemplary embodiment of the present invention;

FIG. 11 is a diagram illustrating an exemplary embodiment of storinginformation about a transform scheme in a macro block header;

FIG. 12 is a diagram illustrating an exemplary embodiment of the presentinvention of storing, in a slice header, information about whether thepresent invention is applied;

FIG. 13 is a block diagram illustrating a configuration of a imagedecoding apparatus according to the present invention; and

FIG. 14 is a block diagram illustrating a configuration of an imagecoding apparatus according to another exemplary embodiment of thepresent invention.

BRIEF SUMMARY OF INVENTION

An aspect of the present invention provides a method of increasing acompression rate of an image block when a quantized transformcoefficient is generated, through a transform and quantization afterperforming prediction of inter/intra image with respect to apredetermined sized of block (macroblock).

According to an aspect of an exemplary embodiment, there is provided anapparatus of coding an image, including a first transforming unit totransform a target image into a first transform coefficient based on adiscrete cosine transform (DCT) scheme, a second transforming unit totransform the target image into a second transform coefficient based ona discrete sine transform (DST) scheme, and a transform schemedetermining unit to select one of the first transform coefficient andthe second coefficient as a transform coefficient of the target image.

According to another aspect of an exemplary embodiment, there isprovided an apparatus of decoding an image, including a transform schemedecision unit to decide a transform scheme with respect to a transformcoefficient, a first inverse transforming unit to generate a decodedimage with respect to the transform coefficient by using a discretecosine inverse transform scheme, when the transform scheme is a DCT, anda second inverse transforming unit to generate the decoded image withrespect to the transform coefficient by using a discrete sine inversetransform scheme, when the transform scheme is a DST.

According to another aspect of an exemplary embodiment, there isprovided an apparatus of coding an image, including a first transformingunit to generate a first transform coefficient by performing a DCT withrespect to a target image, a second transforming unit to generate asecond transform coefficient by performing a DST with respect to thetarget image, and a transform scheme determining unit to select one ofthe first transform coefficient and the second transform coefficient asa transform coefficient with respect to the target image.

According to the present invention, a compression rate of an image blockincreases when a quantized transform coefficient is generated, through atransform and quantization after performing prediction of inter/intraimage with respect to a predetermined sized of block (macroblock).

DETAILED DESCRIPTION Best Mode for Carrying Out the Invention

Reference will now be made in detail to embodiments of the presentinvention, examples of which are illustrated in the accompanyingdrawings, wherein like reference numerals refer to the like elementsthroughout. The embodiments are described below in order to explain thepresent invention by referring to the figures.

FIG. 1 is a block diagram illustrating an exemplary embodiment of animage coding apparatus where the present invention is applied.

The image coding apparatus includes a transforming and quantizing unit110, an entropy coding unit 120, a coding controlling unit 130, aninverse-quantizing and inverse-transforming unit 140, a loop filter 150,a reference image storage unit 160, a motion estimation/compensationunit 170, and intra prediction/compensation unit 180.

Generally, a coding apparatus may include an encoding process and adecoding process, and a decoding apparatus includes a decoding process.The decoding process of the decoding apparatus is the same as a decodingprocess of the coding apparatus. Accordingly, hereinafter, the codingapparatus will be mainly described.

The motion estimation/compensation unit 170 and the intraprediction/compensation unit 180 may generate a prediction image withrespect to an input image. The motion estimation/compensation unit 170and the intra prediction/compensation unit 180 may generate theprediction image with respect to the input image based on a referenceimage with respect to the input image. The reference image storage unit160 may store the reference image with respect to the input image. Adifference between the input image and the prediction image is aresidual image. According to an exemplary embodiment of the presentinvention, the image coding apparatus may improve a coding efficiencyhigher compared to when the input image is coded by coding the residualimage. That is, the residual image may be used as a target image of theimage coding apparatus.

The target image may be inputted to the transforming and quantizing unit110. The transforming and quantizing unit 110 may generate a firsttransform coefficient by performing a discrete cosine transform (DCT),quantization, and coefficient threshold operation on the target image.Also, the transforming and quantizing unit 110 may generate a secondtransform coefficient by performing a discrete sine transform (DST),quantization, and the coefficient threshold operation on the targetimage. The entropy coding unit 120 may generate a bit stream by entropycoding with respect to the discrete cosine transformed first transformcoefficient or the discrete sine transformed second transformcoefficient. In this instance, the coding controlling unit 130 performsan inverse-quantization and a discrete cosine inverse transform on thefirst transform coefficient, and performs an inverse-quantization and adiscrete sine inverse transform on the second transform coefficient,thereby determining an optimum transform scheme. The coding controllingunit 130 may transmit the determined transform scheme to thetransforming and quantizing unit 110.

Referring to the decoding process 190, the inverse quantizing andinverse transforming unit 140 may perform inverse quantizing and adiscrete cosine inverse transform on the first transform coefficient togenerate a decoded image with respect to the first transformcoefficient, and may perform inverse quantizing and a discrete sineinverse transform on the second transform coefficient to generate adecoded image with respect to the second transform coefficient. The loopfilter 150 may perform low pass filtering with respect to each decodedimage and may smooth a block boundary. The reference image storage unit160 may store the decoded image in which the block boundary is smoothed,as the reference image.

In a case of an inter mode, the motion compensation unit 170 maycompensate for a motion by comparing the stored reference image with theinput image. In a case of an intra mode, the intraprediction/compensation unit 180 may perform intra compensation withoutpassing through the loop filter 150 and the reference image storage unit160.

FIG. 2 is a block diagram illustrating a configuration of an imagecoding apparatus according to an exemplary embodiment of the presentinvention.

An image predicting unit 210 may generate a prediction image withrespect to an input image based on a reference image with respect to theinput image. The image predicting unit 210 may calculate a differencebetween the input image and the prediction image, as a target image.

A first transforming unit 220 may transform the target image into afirst transform coefficient based on a DCT scheme. The firsttransforming unit 220 may include a discrete cosine transforming unit221 and a quantizing unit 222.

The discrete cosine transforming unit 221 may perform a DCT on thetarget image to generate a first image coefficient. The quantizing unit222 may quantize the first image coefficient to generate the firsttransform coefficient.

A second transforming unit 230 may transform the target image into asecond transform coefficient based on a DST. The second transformingunit 230 may include the discrete sine transforming unit 231 and aquantizing unit 232.

Operations of the discrete cosine transforming unit 221 and thequantizing unit 222 included in the first transforming unit 220 aresimilar to operations of the discrete sine transforming unit 231 and thequantizing unit 232 included in the second transforming unit 230, andthus, hereinafter, the operation of the second transforming unit 230will be described in detail.

The discrete sine transforming unit 231 may generate a second imagecoefficient by performing the DST on the target image. The quantizingunit 232 may quantize the second image coefficient to generate a secondtransform coefficient.

According to an exemplary embodiment, the discrete sine transformingunit 231 may perform the DST on the target image based on Equation 1 asbelow.

$\begin{matrix}{{{Y(k)} = {\sqrt{\frac{2}{N + 1}}{\sum\limits_{n = 0}^{N - 1}\;{{X(n)}\;\sin\;\frac{{\pi\left( {k + 1} \right)}\left( {n + 1} \right)}{N + 1}}}}},{0 \leq k \leq {N - 1}}} & \left\lbrack {{Equation}\mspace{20mu} 1} \right\rbrack\end{matrix}$

Here, X indicates the target image to be discrete sine transformed, andY indicates the second image coefficient that is discrete sinetransformed. Also, N is a unit size of the DST.

When the target image is a 4×4 sized image, the DST of Equation 1 may beexpressed as a matrix of Equation 2 below.

$\begin{matrix}{Y = {{S{XS}} = \left( {{\begin{bmatrix}a & b & b & a \\b & a & {- a} & {- b} \\b & {- a} & {- a} & b \\a & {- b} & b & {- a}\end{bmatrix}\lbrack X\rbrack}\begin{bmatrix}a & b & b & a \\b & a & {- a} & {- b} \\b & {- a} & {- a} & b \\a & {- b} & b & {- a}\end{bmatrix}} \right)}} & \left\lbrack {{Equation}\mspace{14mu} 2} \right\rbrack\end{matrix}$

S indicates a DST matrix with respect to each row of X, X indicates thetarget image, and Y indicates the inverse-quantized second imagecoefficient. Also, elements a and b in the matrix indicate constants

$\sqrt{\frac{2}{5}}{\sin\left( \frac{\pi}{5} \right)}$ and${\sqrt{\frac{2}{5}}{\sin\left( {\frac{2}{5}\pi} \right)}},$

respectively.

The elements a and b the matrix are not integers, and thus, acalculation process is extremely complex when a calculation is actuallyperformed. According to an exemplary embodiment, the discrete sinetransforming unit 231 may perform an integer sine transform on thetarget image based on an integer sine transform matrix obtained from theDST matrix. The integer sine transform may be expressed as given inEquation 3 below.

$\begin{matrix}{Y = {{S_{f}XS_{f}^{T}} = \left( {{\begin{bmatrix}1 & 2 & 2 & 1 \\1 & 1 & {- 1} & {- 1} \\2 & {- 1} & {- 1} & 2 \\1 & {- 1} & 1 & {- 1}\end{bmatrix}\lbrack X\rbrack}\begin{bmatrix}1 & 1 & 2 & 1 \\2 & 1 & {- 1} & {- 1} \\2 & {- 1} & {- 1} & 1 \\1 & {- 1} & 2 & {- 1}\end{bmatrix}} \right)}} & \left\lbrack {{Equation}\mspace{20mu} 3} \right\rbrack\end{matrix}$

FIG. 3 is a diagram illustrating a concept of an integer sine transformaccording to an exemplary embodiment of the present invention.

When a target image is in a size of 4×4, the integer sine transform ofEquation 3 may be easily performed according to the exemplary embodimentof FIG. 3.

When the target image is in a size of 8×8, the DST of Equation 1 may beexpressed as given in Equation 4 below.

$\begin{matrix}{Y = {{S_{f}XS_{f}^{T}} = {{\begin{bmatrix}{{0.3}75} & {{0.7}5} & {{1.2}5} & {1.5} & {1.5} & {{1.2}5} & {{0.7}5} & {{0.3}75} \\0.5 & 1 & 1 & {0.5} & {- {0.5}} & {- 1} & {- 1} & {- {0.5}} \\{{0.7}5} & {1.5} & {{0.3}75} & {{- {1.2}}5} & {{- {1.2}}5} & {{0.3}75} & {1.5} & {{0.7}5} \\1 & 1 & {- 1} & {- 1} & 1 & 1 & {- 1} & {- 1} \\{{1.2}5} & {{0.3}75} & {- {1.5}} & {{0.7}5} & {{0.7}5} & {- {1.5}} & {{0.3}75} & {{1.2}5} \\1 & {- {0.5}} & {- {0.5}} & 1 & {- 1} & {0.5} & {0.5} & {- 1} \\1.5 & {{- {1.2}}5} & {{0.7}5} & {{- {0.3}}75} & {{- {0.3}}75} & {{0.7}5} & {{- {1.2}}5} & {1.5} \\1 & {- 1} & 1 & {- 1} & 1 & {- 1} & 1 & {- 1}\end{bmatrix} \cdot \lbrack X\rbrack}{\quad\begin{bmatrix}{{0.3}75} & 0.5 & {{0.7}5} & 1 & {{1.2}5} & 1 & {1.5} & 1 \\{{0.7}5} & 1 & {1.5} & 1 & {{0.3}75} & {- {0.5}} & {{- {1.2}}5} & {- 1} \\{{1.2}5} & 1 & {{0.3}75} & {- 1} & {- {1.5}} & {- {0.5}} & {{0.7}5} & 1 \\{1.5} & 0.5 & {{- {1.2}}5} & {- 1} & {{0.7}5} & 1 & {{- {0.3}}75} & {- 1} \\{1.5} & {- {0.5}} & {{- {1.2}}5} & 1 & {{0.7}5} & {- 1} & {{- {0.3}}75} & 1 \\{{1.2}5} & {- 1} & {{0.3}75} & 1 & {- {1.5}} & {0.5} & {{0.7}5} & {- 1} \\{{0.7}5} & {- 1} & {1.5} & {- 1} & {{0.3}75} & {0.5} & {{- {1.2}}5} & 1 \\0.375 & {- {0.5}} & {{0.7}5} & {- 1} & {{1.2}5} & {- 1} & 1.5 & {- 1}\end{bmatrix}}}}} & \left\lbrack {{Equation}\mspace{14mu} 4} \right\rbrack\end{matrix}$

The quantizing unit 232 may generate a second transform coefficient byquantizing a second image coefficient. According to an exemplaryembodiment, when the target image is in the size of 4×4, the quantizingunit 232 may quantize the second image coefficient based on Equation 5or Equation 6 as below.

$\begin{matrix}{\mspace{79mu}{Z_{({i,j})} = {{round}\mspace{14mu}\left( \frac{Y_{({i,j})}}{QStep} \right)}}} & \left\lbrack {{Equation}\mspace{20mu} 5} \right\rbrack \\{{Z_{({i,j})} = {{sgn}\;{\left( Y_{({i,j})} \right) \cdot \left( {{{Y_{({i,j})}} \cdot {MF}_{({i,j})}} + {DZ}} \right)}}}\operatorname{>>}\left( {15 + Q_{D}} \right)} & \left\lbrack {{Equation}\mspace{14mu} 6} \right\rbrack\end{matrix}$

Y_((i,j)) indicates a second image coefficient that is integer sinetransformed at (i,j) of the 4×4 matrix, Z_((i,j)) and is a secondtransform coefficient that is generated by quantizing a second transformcoefficient at the (i,j) of the 4×4 matrix. Q_(D) indicates a value of

$\left\lfloor \frac{QP}{6} \right\rfloor,$

and QP indicates a quantization parameter. MF_((i,j)) indicates amultiplication factor. QStep indicates a step size of a quantizing unit,and round( ) indicates a rounding-off function. DZ performs a functionof adjusting a dead zone during a quantizing process and a value ofwhich is selected between 0 and ½. sgn(·) is a sign function.

FIG. 4 is a diagram illustrating a value of a multiplication factor in aquantizing process with respect to a 4×4 sized image.

According to an exemplary embodiment, when a target image is in a sizeof 8×8, the quantizing unit 232 may quantize a second image coefficientbased on Equation 7 to generate a second transform coefficient.

Z _((i,j))=sgn(Y _((i,j)))·(|Y _((i,j)) |·MF _((i,j)) +DZ)>>(16+Q_(D))  [Equation 7]

FIG. 5 is a diagram illustrating a value of a multiplication factor in aquantizing process with respect to an 8×8 sized image.

The transform scheme determining unit 260 may select one of a firsttransform coefficient and a second transform coefficient as a transformcoefficient with respect to a target image.

According to an exemplary embodiment, the first transforming unit 220may generate a first decoded image with respect to the target imagebased on the first transform coefficient, and the second transformingunit 230 may generate a second decoded image with respect to the targetimage based on the second transform coefficient. The transform schemedetermining unit 260 may select a transform image with respect to thetarget image by comparing the target image, the first decoded image, andthe second decoded image.

According to another exemplary embodiment, the transform schemedetermining unit 260 may select the transform image with respect to thetarget image further based on a number of bits of the first decodedimage, a bit rate of the first decoded image, a number of bits of thesecond decoded image, and a bit rate of the second decoded image. Thatis, the transform scheme determining unit may select, as the transformcoefficient with respect to the target image, a transform coefficientcorresponding to a decoded image having a smaller number of bits or asmaller bit rate from among the first decoded image and the seconddecoded image.

Also, according to another exemplary embodiment, the transform schemedetermining unit 260 may select the transform image with respect to thetarget image further based on a distortion of the first decoded imageand a distortion of the second decoded image. As an example, thetransform scheme determining unit 260 may select the transformcoefficient with respect to the target image based on the distortion ofthe decoded image together with the bit rate of the decoded image.

The first transforming unit 220 may include a DCT coefficient thresholdunit 223, an inverse quantizing unit 224, a discrete cosine inversetransforming unit 225 to generate the first decoded image.

The DCT coefficient threshold unit 223 may perform a coefficientthreshold operation on the first transform coefficient. The inversequantizing unit 224 may perform an inverse-quantization on thecoefficient threshold-operated first transform coefficient, and thediscrete cosine inverse transforming unit 224 may generate the firstdecoded image with respect to the target image by performing thediscrete cosine inverse transform on the inverse-quantized firsttransform coefficient. The transform scheme determining unit 260 mayselect the transform coefficient based on the first decoded image.

The second transforming unit 230 may include the DST coefficientthreshold unit 233, the inverse quantizing unit 234, and the discretesine inverse transforming unit 225.

Operations of the DCT coefficient threshold unit 223, the inversequantizing unit 224, and a discrete cosine inverse transforming unit 225included in the first transforming unit 220 are similar to operations ofthe DST coefficient threshold unit 233, the inverse quantizing unit 234,and the discrete sine inverse transforming unit 225 included in thesecond transforming unit 230, and thus, hereinafter, the operation ofthe second transforming unit 230 will be described in detail.

The DST coefficient threshold unit 233 may perform a coefficientthreshold operation on the quantized second transform coefficient.

A coefficient threshold operation of the DST coefficient threshold unit233 will be described in detail with reference to FIG. 9.

The quantized second transform coefficient may calculate costs (a valuerepresented as 3, 2, 1, and 0 in a left side of FIG. 4) with respect tocoefficients occurring in each of a 4×4 frequency domain through acoefficient threshold operation of FIG. 9, may calculate a sum of allcosts in a 8×8 block unit, may substitute “0” for all the transformedcoefficient of the corresponding 8×8 block when the sum of the costs isless than a predetermined threshold, and may determine a CBP withrespect to the corresponding block as zero. The sum of the costs may beapplicable when an absolute value of the transform coefficient in thecorresponding frequency domain is “1”.

In this instance, when an absolute value of a coefficient in a frequencydomain is greater than zero, an arbitrary high number may be used as acost with respect to the corresponding transform coefficient so that alltransform coefficients are prevented from being zero in a corresponding4×4 block unit, an 8×8 block unit, and a macroblock unit.

Also, when a total sum of costs based on a macroblock unit includingfour 8×8 block is less than a predetermined threshold, all coefficientsof the corresponding macroblock are replaced with zero, and a CBP withrespect to each of the 8×8 block may be determined as zero.

According to a joint model (JM) that is an H.264/AVC reference model,and an ITU-T VCEG KTA reference model, a fixed constant, 4, is used as athreshold in an 8×8 block unit and a fixed constant, 5, is used as athreshold in a macroblock unit.

In FIG. 9 (a), the total sum of all costs of transform coefficients ofthe 8×8 block is 5, and thus, the all coefficients are not replaced withzero. In FIG. 9 (b), the total sum of all costs of transformcoefficients of the 8×8 block is zero, and thus, the all coefficientsare replaced with zero.

The inverse quantizing unit 234 may perform inverse quantization on thecoefficient threshold-operated second transform coefficient. Accordingto an exemplary embodiment, when the target image is a 4×4 block, theinverse quantizing unit 234 may perform inverse quantization on thesecond transform coefficient based on Equation 8.

Y′ _((i,j)) =Z _((i,j))·QStep  [Equation 8]

Y′_((i,j)) is an inverse-quantized second transform coefficient, andSF_((i,j)) is a scaling factor.

FIG. 6 is a diagram illustrating a value of a scaling factor SF_((i,j))in an inverse-quantizing process with respect to a 4×4 sized image.

According to exemplary embodiment, when the target image is in a size of8×8, the inverse quantizing unit 234 may perform inverse quantization onthe coefficient threshold-operated second transform coefficient based onEquation 9 as below.

Y′ _((i,j))=(Z _((i,j)) ·SF _((i,j)))>>Q _(D)  [Equation 9]

FIG. 7 is a diagram illustrating a value of a scaling factor SF_((i,j))in an inverse-quantizing process with respect to an 8×8 sized image.

The discrete since inverse transforming unit 235 may perform discretesine inverse transform on the inverse-quantized second transformcoefficient and may generate a second decoded image with respect to thetarget image. According to an exemplary embodiment, the discrete sineinverse transforming unit 235 may generate the second decoded imagebased on Equation 10 as below.

$\begin{matrix}{X^{\prime} = {{SYS} = \left( {{\begin{bmatrix}a & b & b & a \\b & a & {- a} & {- b} \\b & {- a} & {- a} & b \\a & {- b} & b & {- a}\end{bmatrix}\left\lbrack Y^{\prime} \right\rbrack}\begin{bmatrix}a & b & b & a \\b & a & {- a} & {- b} \\b & {- a} & {- a} & b \\a & {- b} & b & {- a}\end{bmatrix}} \right)}} & \left\lbrack {{Equation}\mspace{20mu} 10} \right\rbrack\end{matrix}$

S indicates a discrete sine inverse transform matrix with respect toeach row of X, X′ indicates a target object, and Y′ indicates ainverse-quantized transform coefficient. Also, elements a and b in thematrix indicate constants

$\sqrt{\frac{2}{5}}{\sin\left( \frac{\pi}{5} \right)}$ and${\sqrt{\frac{2}{5}}{\sin\left( {\frac{2}{5}\pi} \right)}},$

respectively.

The elements a and b in the matrix are not integer, and thus, acalculation process is extremely complex when calculation is actuallyexecuted. According to an exemplary embodiment, the discrete sineinverse transforming unit 235 may perform a integer sine inversetransform on the second decoded image based on a integer sine inversetransform matrix obtained from the integer sine inverse transformmatrix. The integer sine inverse transform may be expressed as given inEquation 11 below.

$\begin{matrix}{X^{\prime} = {{S_{i}^{T}Y^{\prime}S_{i}} = {{\begin{bmatrix}\frac{1}{2} & 1 & 1 & 1 \\1 & 1 & {- \frac{1}{2}} & {- 1} \\1 & {- 1} & {- \frac{1}{2}} & 1 \\\frac{1}{2} & {- 1} & 1 & {- 1}\end{bmatrix}\left\lbrack Y^{\prime} \right\rbrack}\begin{bmatrix}\frac{1}{2} & 1 & 1 & \frac{1}{2} \\1 & 1 & {- 1} & {- 1} \\1 & {- \frac{1}{2}} & {- \frac{1}{2}} & 1 \\1 & {- 1} & 1 & {- 1}\end{bmatrix}}}} & \left\lbrack {{Equation}\mspace{14mu} 11} \right\rbrack\end{matrix}$

FIG. 8 is a diagram illustrating a concept of integer sine transformaccording to an exemplary embodiment of the present invention.

When a target image is in a size of 4×4, an integer sine inversetransform of FIG. 11 may be performed based on the exemplary embodimentof FIG. 8.

A second decoded image X′ generated by a discrete sine inverse transformmay be rounded off based on Equation 12 and may be expressed asX′_((i,j)).

X′ _((i,j))=round(X′ _((i,j)))  [Equation 12]

Also, a second decoded image X′ restored by the integer sine inversetransform may be passed through a post-scaling process based on Equation13 and may be expressed as X′_((i,j))

$\begin{matrix}{X_{({i,j})}^{''} = {{round}\mspace{14mu}\left( \frac{X_{({i,j})}^{\prime}}{64} \right)}} & \left\lbrack {{Equation}\mspace{20mu} 13} \right\rbrack\end{matrix}$

A Lagrange multiplier calculator 240 may calculate a Lagrange multiplierof each of a first decoded image and a second decoded image, and adistortion rate measuring unit 250 measures a distortion rate of thefirst decoded image and a distortion rate of the second decoded imagebased on each calculated Lagrange multiplier.

According to an exemplary embodiment, in a case of an I-frame or ap-frame, the Lagrange multiplier calculator 240 may calculate a Lagrangemultiplier based on Equation 14 as below.

λ_(MODE,I,P) =C×2^((QP . . . 12)/3)  [Equation 14]

C may be determined through an experiment with respect to variousimages, or may be adaptively determined based on a size of the targetimage.

According to another exemplary embodiment, in a case of a B-frame, theLagrange multiplier calculator 240 may calculate a Lagrange multiplierbased on Equation 15 as below.

$\begin{matrix}{\lambda_{{MODE},B} = {{\max\left( {2,{\min\left( {4,\frac{{QP} - {12}}{6}} \right)}} \right)} \times \lambda_{{MODE},I,P}}} & \left\lbrack {{Equation}\mspace{20mu} 15} \right\rbrack\end{matrix}$

The rate-distortion cost calculator 250 may calculate a rate-distortioncost (R-D cost) with respect to the first decoded image and the seconddecoded image.

According to an exemplary embodiment, the rate-distortion costcalculator 250 may calculate the rate-distortion cost based on Equation16 as below.

J(s,c,MODE|QP,λ _(MODE))=SSD(s,c,MODE|QP)+λ_(MODE)·R(s,c,MODE|QP)  [Equation 16]

Here, s is a target image and c is a decoded image. SSD(s,c,MODE|QP) isa distortion of each decoded image and R(s,c,MODE|QP) is a number ofbits of each decoded image. MODE is a coding mode used for an imagecoding.

The rate-distortion cost calculator 260 may calculate a rate-distortioncost with respect to each mode to select an optimum mode from amongevery possible coding mode used for image coding, such as a variableblock mode, four types of space prediction mode, a SKIP mode (P SKIPmode and B SKIP mode), a DIRECT mode, and the like. That is, therate-distortion cost calculator 260 may calculate a rate-distortion withrespect to each restoration image and each coding mode.

The transform scheme determining unit 260 may select a transformcoefficient corresponding to a restoration image having a smallestrate-distortion cost, as a transform coefficient with respect to thetarget image. That is, the transform scheme determining unit 260 mayselect an optimum transform scheme based on the distortion of eachrestoration image and a bit rate required for coding the transformcoefficient.

Also, the transform scheme determining unit 260 may determine a modehaving a smallest rate-distortion cost as the coding mode. That is, thetransform scheme determining unit 260 may select a transform mode havinga high compression efficiency as a transform mode with respect to thetarget image.

The transform scheme storage unit 270 may store information about atransform scheme corresponding to the transform coefficient with respectto the target image. That is, the transform scheme storage unit 270 maystore information about whether the target image is discrete cosinetransformed or discrete sine transformed, and an image decodingapparatus may determine a transform scheme with respect to the targetimage based on the information about the transform scheme.

According to an exemplary embodiment, the transform scheme storage unit270 may represent information about the transform scheme by using a flagbit included in a macro block unit. As an example, when the target imageincluded in a macro block is discrete cosine transformed, the flag bitmay be determined as “0”. Also, when the target image included in themacro block is discrete sine transformed, the flag bit may be determinedas “1”.

The transform scheme storage unit 270 may store information about thetransform scheme based on CBP value with respect to the transformcoefficient. The CBP value, which represents a luminance value of eachblock, represents “1” when there is a transform coefficient in acorresponding block and represents “0” when there is no transformcoefficient in the corresponding block. When there is no transformefficient in a predetermined block, there is no need to determine atransform scheme with respect to the corresponding block, and thus,there is no need to store information about a transform scheme.

FIG. 10 is a diagram illustrating an exemplary embodiment of storingtransform scheme information based on coded block pattern (CBP)according to an exemplary embodiment of the present invention.

FIG. 10 (a) illustrates an exemplary embodiment that all blocks 1011,1012, 1013, and 1014 do not include transform coefficients. In thisinstance, a image decoding apparatus may not need to determine atransform scheme with respect to a transform coefficient for each block.

Accordingly, the transform scheme storage unit 270 may not storeinformation about the transform scheme of each block. That is, thetransform scheme storage unit 270 may store information about atransform scheme with respect to a corresponding block, only when a CBPwith respect to each block is “1”.

FIG. 10 (b) illustrates an exemplary embodiment that a second block anda third block do not have transform coefficients. A first block 1021 anda fourth block 1024 have transform coefficients, and each of thetransform coefficients is discrete sine transformed and discrete cosinetransformed respectively.

The transform scheme storage unit 270 may store transform schemeinformation with respect to each of the first block 1021 and the fourthblock 1041 which have corresponding transform coefficients. The firstblock 1021 is discrete sine transformed, and thus, the information aboutthe transform scheme may be determined as “1”. Also, the fourth block1024 is discrete cosine transformed, and thus, the information about thetransform scheme may be determined as “0”.

The image decoding apparatus may determine a block corresponding toinformation about a transform scheme of “10” based on the CBP valuecoded for each block.

FIG. 10 (c) illustrates an exemplary embodiment that a first block 1031includes a transform coefficient, and a second block 1032, a third block1033, and a fourth block 1034 do not include transform coefficients. Thetransform scheme storage unit 270 may store information about atransform scheme with respect to the first block 1031 having thetransform coefficient.

FIG. 10 (d) illustrates an exemplary embodiment that a first block 1041does not include a transform coefficient, and a second block 1042, athird block 1043, and a fourth block 1044 include transformcoefficients. The transform scheme storage unit 270 may store transformscheme information about transform schemes with respect to the secondblock 1042, the third block 1043, and the fourth block 1044.

FIG. 11 is a diagram illustrating an exemplary embodiment of storinginformation about a transform scheme in a macro block header.

Referring to a storage portion 1110 of a macro block head of FIG. 11that stores information about a transform scheme, the transform schemestorage unit 270 may store the information (alternative transform flag)about the transform scheme, when a CBP is greater than “0”.

FIG. 12 is a diagram illustrating an exemplary embodiment of the presentinvention of storing, in a slice header, information about whether thepresent invention is applied.

According to an exemplary embodiment, the image coding apparatus maycode a target image by applying the present invention, and according toanother exemplary embodiment, the image coding apparatus may not applythe present invention. The transform scheme storage unit 270 may store,by using a flag bit of a slice header, information 1210 about whetherthe present invention is applied, and a image decoding apparatus maydetermine whether the present invention is applied to a transformcoefficient, by using the flag bit.

FIG. 13 is a block diagram illustrating a configuration of a imagedecoding apparatus according to the present invention. The imagedecoding apparatus according to the present invention includes atransform scheme decision unit 1310, a first inverse transforming unit1320, and a second inverse transforming unit 1330.

The transform scheme decision unit 1310 may decide whether the presentinvention is applied to a transform coefficient. According to anexemplary embodiment, when an image coding apparatus applies the presentinvention to the transform coefficient to code a target image, the imagecoding apparatus may represent whether the present invention is appliedto the transform coefficient, by using a flag bit of a slice header. Thetransform scheme decision unit may decide whether the present inventionis applied to the transform coefficient, by using a flag bit of a slice.

Also, the transform scheme decision unit 1310 may decide a transformscheme with respect to a transform coefficient. When the presentinvention is applied to the transform coefficient, the transformcoefficient may be discrete sine transformed or discrete cosinetransformed. The image coding apparatus may represent a transform schemeapplied to the transform coefficient by using a flag bit of amacroblock. That is, the flag bit of the macroblock may representtransform scheme information. The transform scheme decision unit 1310may decide the transform scheme with respect to the transformcoefficient, by using the flag bit of the macroblock.

According to an exemplary embodiment, the flag bit of the macroblock maybe stored based on a CBP value with respect to the transformcoefficient. That is, the image coding apparatus may store the flag bitin the macroblock only when the CBP value is not “0”, and may not storethe flag bit in the macroblock when the CBP is “0”.

When the transform coefficient is discrete sine transformed, the firstinverse transforming unit 1320 may generate a decoded image with respectto the transform coefficient by using a discrete sine inverse transformscheme. The first inverse transforming unit 1320 may include an inversequantizing unit 1321 and a discrete sine inverse transforming unit 1322.

The inverse quantizing unit 1321 performs inverse quantization on aquantized transform coefficient. Inverse quantization has already beendescribed with reference to FIG. 2, and thus, hereinafter, a detaileddescription thereto will be omitted.

The discrete sine inverse transforming unit 1322 performs discrete sineinverse transform on an inverse-quantized transform coefficient togenerate a decoded image. Discrete sine inverse transform has alreadybeen described with reference to FIG. 2, and thus, hereinafter, adetailed description thereto will be omitted.

When the discrete cosine transform is applied to the transformcoefficient, the second inverse transforming unit 1330 generates adecoded image with respect to the transform coefficient by using adiscrete cosine inverse transform scheme. The second inversetransforming unit 1330 may include an inverse quantizing unit 1331 and adiscrete cosine inverse transforming unit 1332.

The inverse quantizing unit 1331 may perform inverse quantization on aquantized transform coefficient. The inverse quantization has alreadybeen described with reference to FIG. 2, and thus, hereinafter, adetailed description thereto will be omitted.

The discrete cosine inverse transforming unit 1332 may perform discretecosine inverse on an inverse-quantized transform coefficient to generatea decoded image.

According to an exemplary embodiment, a decoded image generated from thefirst inverse transforming unit 1320 or the second inverse transformingunit 1330 is not an input image inputted to the image coding apparatus,but corresponds to a residual image that is a difference between theinput image and a prediction image.

The image restoring unit 1340 may generate a prediction image withrespect to a transform coefficient based on a reference image withrespect to the transform coefficient. The image restoring unit 1340 maygenerate a restoration image with respect to the transform coefficientbased on the prediction image and the decoded image. The restorationimage corresponds to the input image inputted to the image codingapparatus.

FIG. 14 is a block diagram illustrating a configuration of an imagecoding apparatus according to another exemplary embodiment of thepresent invention. The image coding apparatus may include an imagepredicting unit 1410, a first transforming unit 1420, a secondtransforming unit 1430, a distortion rate measuring unit 1440, atransform scheme determining unit 1450, and a transform scheme storageunit 1460.

The image predicting unit 1410 may generate a prediction image withrespect to an input image based on a reference image with respect to theinput image. Also, the image predicting unit 1410 may calculate adifference between the input image and the prediction image as a targetimage. That is, a target image that is coded by the first transformingunit 1420 or the second transforming unit 1430 is a residual image withrespect to the input image.

The first transforming unit 1420 may generate a first transformcoefficient by performing a discrete cosine transform on the targetimage. Also, the first transforming unit 1420 may generate a decodedimage with respect to a first transform coefficient by performing adiscrete cosine inverse transform on the first transform coefficient.

The second transforming unit 1430 may generate a second transformcoefficient by performing a discrete sine transform on the target image.Also, the second transforming unit 1430 may generate a decoded imagewith respect to the second transform coefficient by performing adiscrete sine inverse transform on the first transform coefficient.

The distortion measuring unit 1440 may compare the target image with thedecoded image with respect to the first transform coefficient to measurea distortion rate of the decoded image with respect to the firsttransform coefficient. Also, the distortion rate measuring unit 1440 maycompare the target image with the decoded image with respect to thesecond transform coefficient to measure a distortion rate of the decodedimage with respect to the second transform coefficient.

The transform scheme determining unit 1450 may select a transformcoefficient with respect to the target image based on the distortionrate of the decoded image with respect to the first transformcoefficient and the distortion rate of the decoded image with respect tothe second transform coefficient. As an exemplary embodiment, thetransform scheme determining unit 1450 may select a transformcoefficient corresponding to a decoded image having a smaller distortionrate as the transform coefficient with respect to the target image.

The transform scheme storage unit 1460 may store transform schemeinformation with respect to the selected transform coefficient in amacroblock header. As an example, when the transform coefficient isdiscrete sine transformed, the transform scheme storage unit 1460 maystore the transform scheme information by representing a flag bit of themacroblock head as “1”. Also, when the transform coefficient is discretecosine transformed, the transform scheme storage unit 1460 may store thetransform scheme information by representing the flag bit of the macroblock header as “0”.

According to an exemplary embodiment, the transform scheme storage unit1470 may store the transform scheme information based on a CBP withrespect to the transform coefficient. A CBP value indicates existence ofa transform coefficient. That is, when the transform coefficient exists,the CBP value may be “1”, and when the transform coefficient does notexist, the CBP value may be “0”. The transform scheme storage unit 1470may not store the transform scheme information when the CBP value is“0”.

Although a few embodiments of the present invention have been shown anddescribed, the present invention is not limited to the describedembodiments. Instead, it would be appreciated by those skilled in theart that changes may be made to these embodiments without departing fromthe principles and spirit of the invention, the scope of which isdefined by the claims and their equivalents.

What is claimed is:
 1. An apparatus for decoding an image, the apparatuscomprising: an input for receiving a coded image comprising blocks; anda processor to decode an image block, wherein the processor: determines,based on a coded block pattern (CBP) value, whether or not transformcoefficients of the image block include at least one non-zero transformcoefficient; in response to the CBP value indicating that the transformcoefficients of the image block include at least one non-zero transformcoefficient, obtains the transform coefficients and a first flag bit forthe image block by entropy-decoding an input bitstream; dequantizes thetransform coefficients of the image block to generate dequantizedtransform coefficients for the image block; determines, based on thefirst flag bit, whether neither of a first inverse-transform based on adiscrete cosine transform (DCT) and a second inverse-transform based ona discrete sine transform (DST) is to be performed on the dequantizedtransform coefficients for the image block; determines, based on asecond flag bit, a selected inverse-transform with respect to the imageblock, the selected inverse-transform being one of the firstinverse-transform based on the discrete cosine transform (DCT) or thesecond inverse-transform based on the discrete sine transform (DST);generates a residual image for the image block by performing theselected inverse-transform on the dequantized transform coefficients forthe image block; and reconstructs the image block by adding the residualimage and a prediction image for the image block, wherein thedetermining the selected inverse-transform based on the second flag bitis performed both when the transform coefficients of the image block aredetermined to include at least one non-zero transform coefficient basedon the CBP value and when it is determined that one of the firstinverse-transform and the second inverse-transform is to be performedbased on the first flag bit.
 2. The apparatus of claim 1, wherein thesecond flag bit is signaled by a unit of a macroblock.
 3. The apparatusof claim 2, wherein the first flag bit is signaled by a unit of a slice.